<%--
  Created by IntelliJ IDEA.
  User: zhaojunmin
  Date: 2018/4/29
  Time: 16:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    int n = 0;
    String counter = (String) session.getAttribute("counter");
    if (counter != null) {
        n = Integer.parseInt(counter);
    }
    if (session.isNew()) {
        ++n;
    }
    counter = String.valueOf(n+1);
    session.setAttribute("counter", counter);
    out.print("你的访问次数是：" + n );
%>

</body>
</html>
